﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SISGEZATBZVisual.BusinessEntities;

namespace SISGEZATBZVisual.Repository.Mapping
{
    public class TrasladoExternoMap:EntityTypeConfiguration<TrasladoExterno>
    {
        public TrasladoExternoMap()
        {
            this.HasKey(r => r.Id);

            //propiedades
            this.Property(r => r.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(r => r.FechaTrasladoExterno)
                .IsRequired();


            //table
            this.ToTable("Traslado Externo");

            //Relaciones
            this.HasRequired(r => r.Matricula)
                .WithOptional(c => c.TrasladoExterno);

        }

    }
}
